import { caseIndex } from '@/utils/database'
export const columns = [
  {
    name: 'deviceId',
    label: '设备编码',
    value: '',
    span: 8,
    valueType: 'input',
    search: true,
    width: 150,

    attrs: {
      maxlength: 70,
      clearable: true,
      placeholder: '请输入设备编码',
    },
  },
  {
    name: 'venderName',
    label: '拖拉机型号',
    width: 250,
  },
  {
    name: 'ownerName',
    label: '所属人用户名',
    width: 250,
  },
  {
    name: 'ownerPhone',
    label: '所属人手机号',
    width: 250,
  },
  {
    name: 'region',
    label: '所属区域',
    showOverflowTooltip: true,
    width: 250,
    formatter: (v) => {
      return `${v.region}${v.city}${v.area}`
    },
  },
  {
    name: 'belong',
    showOverflowTooltip: true,
    width: 250,
    label: '所属人机构',
  },
  {
    name: 'installDate',
    label: '安装时间',
    showOverflowTooltip: true,
    width: 200,
  },
  {
    name: 'installMan',
    label: '安装人姓名',
    width: 160,
    showOverflowTooltip: true,
  },
  {
    name: 'installPhone',
    label: '安装人手机号',
    width: 160,
    showOverflowTooltip: true,
  },
  {
    name: 'factoryCode',
    label: '工厂编码',
    width: 200,
    showOverflowTooltip: true,
  },
  {
    name: 'great',
    label: '品牌',
    width: 200,
    formatter: (v) => {
      return caseIndex(v.great || 'HD')
    },
    showOverflowTooltip: true,
  },
  {
    name: 'endDate',
    label: '结束时间',
    width: 140,
    showOverflowTooltip: true,
  },
]
